import {
  Model,
  Table,
  Column,
  ForeignKey,
  BelongsTo
} from 'sequelize-typescript'
import Chapter from './Chapter'

@Table
export default class Lesson extends Model {
  @Column
  course_id!: number

  @ForeignKey(() => Chapter)
  @Column
  chapter_id!: number

  @Column
  lessonName!: string

  @Column
  brief!: string

  @Column
  sort!: number

  @Column
  is_free!: number

  @Column
  duration!: number

  @Column
  videoId!: number

  @Column
  videoName!: string

  @Column
  vodStatus!: number

  @Column
  coverUrl!: string

  @Column
  coverName!: string

  @Column
  coverStatus!: number

  @Column
  status!: number

  @BelongsTo(() => Chapter)
  chaprer!: Chapter
}
